/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 22652
 * Date: 2024-03-31
 * Time: 11:54
 */
class MyThread7 extends Thread {
    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println(i);
        }
    }
}

public class test_1 {
    public static void main(String[] args) {
        MyThread7 thread = new MyThread7();

        thread.start();
        System.out.println(thread.getName() + "线程的中断状态：" + thread.isInterrupted());
        thread.interrupt(); // 由主线程中断了一个子线程
        System.out.println(thread.getName() + "线程的中断状态：" + thread.isInterrupted());
    }
}
